package com.study.demo_test.controller;

import com.study.demo_test.bean.Book;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * @ClassName: HelloController
 * @Description:
 * @author: WS
 * @date 2020/12/25
 * @Version: 1.0
 **/
@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello(String name) {
        return "hello " + name;
    }

    @PostMapping("/book")
    public Book book(@RequestBody Book book) {
        return book;
    }
}
